#ifndef WINDOW_H
#define WINDOW_H

#include <QtGui>
#include "glwidget.h"
#include "verticesPanel.h"

class Window : public QMainWindow{
	Q_OBJECT

	public:
		Window();
		~Window();

        void keyPressEvent(QKeyEvent *);

    private slots:
        void newScene();
        void openScene();
        void openObject();
        void createVertices(Object *);
        void saveScene();
        void saveObject();
        void importIn();
        void importOut();
//        void importWed();
        void exportIn();
        void exportOut();
        void exportWed();

        void deleteObject();

        void convexHull();
        void selectConvexHullVertices();
        void tetrahedralization();

        void updateWireframeAction(bool);
        void updateActions();
        void updateTree(Object *);
        void updateAllTree();

        void selectTreeItem(QTreeWidgetItem *, int);
        void selectTetrahedron(Tetrahedron *);
        void selectVertex(Vertex *);
        void selectEdge(Edge *);
        void selectFace(Face *);
        void selectObject(Object *);


    private:
        void createMenus();
        void createPanels();
        void createActions();

        QAction *newSceneAct;
        QAction *openSceneAct;
        QAction *openObjectAct;
        QAction *saveSceneAct;
        QAction *saveObjectAct;
        QAction *importInAct;
        QAction *importOutAct;
//        QAction *importWedAct;
        QAction *exportInAct;
        QAction *exportOutAct;
        QAction *exportWedAct;
        QAction *exitAct;

        QAction *deleteObjectAct;

        QAction *convexHullAct;
        QAction *tetrahedralizationAct;

        QAction *showAxisAct;
        QAction *showGridAct;
        QAction *showVerticesAct;
        QAction *showEdgesAct;
        QAction *showWireframeAct;
        QAction *showOpaqueAct;
        QAction *showNormalAct;
//        QAction *showStepByStepAct;
        QAction *viewTreePanelAct;
        QAction *viewVerticesPanelAct;

        QAction *selectConvexHullVerticesAct;

        QDockWidget *treePanelDock;
        QDockWidget *verticesPanelDock;

        QTreeWidget *tree;
        VerticesPanel *verticesPanel;
        GLWidget *canvas;
};

#endif
